docs: add deno desktop reference page#3085
Conversation
Adds a CLI reference page for the new (experimental) deno desktop subcommand which builds self-contained desktop apps from a Deno project. Documents the three rendering backends (cef / webview / raw), framework auto-detection, HMR, the Deno.BrowserWindow / Deno.Tray / Deno.dock APIs, the unified DevTools session, the auto-updater, the cross-compile output formats, and the new \`desktop\` block in deno.json. Marks the surface as still evolving. Adds entries to the CLI index and sidebar. Refs denoland/deno#33441
Adds a new runtime/desktop/ section with 16 guides covering configuration, backends, framework auto-detection, HTTP serving, the BrowserWindow API, bindings, menus, tray/dock, dialogs, HMR, unified DevTools, auto-update, error reporting, distribution, and a comparison vs Electron/Tauri/etc. Slims down runtime/reference/cli/desktop.md to a flag reference that links into the new section, and wires up the sidebar in runtime/_data.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops `command: desktop` and `openGraph*` frontmatter so renderCommand.tsx isn't invoked — there is no `desktop` entry in `_commands_reference.json` yet, and the renderer accesses `.about` unconditionally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fibibot
left a comment
There was a problem hiding this comment.
This PR adds 2,701 lines, which is over the scheduled-review size limit. Can this be split into smaller PRs, for example the reference page skeleton first and the generated/long-form sections separately?
|
Deferred from this release |
deno desktop reference page (2.8)deno desktop reference page
# Conflicts: # runtime/_data.ts
…fork/lunadogbot/docs/2.8-deno-desktop
Update the desktop docs to match the implemented API: - Notifications: add a dedicated page for the Web `Notification` API + permission flow; drop the stale "not yet a Deno API" note. - Menus: `MenuItem` is a tagged union (`item`/`submenu`/`separator`/`role`), not a flat object; roles are now exposed; fix `showContextMenu(x, y, menu)`. - Windows: constructor options (`frameless`/`noActivate`/`transparentTitlebar`), `isClosed()`/`isVisible()`/etc. are methods, `executeJs` is non-generic, `getNativeWindow()` returns an `UnsafeWindowSurface`; drop `BrowserWindow.main`. - Tray/dock: add `getBounds()` + `attachPanel()` popovers; fix dock to `bounce(boolean)`/`setVisible`/`setMenu` + `reopen`; drop `clearMenu`. - Serving: `DENO_SERVE_ADDRESS` is `tcp:127.0.0.1:<port>`, fix URL examples. - Auto-update: patches require a `sha256`; document Ed25519 signed manifests. - Config/distribution: add `app.identifier` + `macos.codesignIdentity`; macOS bundles are code-signed (ad-hoc by default).
| and stages the result for the next launch. If the next launch fails, the runtime | ||
| rolls back to the previous version automatically. | ||
|
|
||
| The update mechanism is inspired by Electrobun: small `bsdiff` patches instead |
There was a problem hiding this comment.
Might as well be inspired by deno upgrade which uses bsdiff. Seems like an implementation detail that doesn't need to be mentioned
bartlomieju
left a comment
There was a problem hiding this comment.
remove all em-dashes from this PR
| ## Calling `autoUpdate()` | ||
|
|
||
| ```ts | ||
| Deno.autoUpdate({ |
There was a problem hiding this comment.
Does this throw during deno run?
| group (WebView). Calls go through `tokio::sync::mpsc` channels and `oneshot` | ||
| channels for responses; the backend dispatches them via a notify / poll pattern | ||
| in its run loop. |
There was a problem hiding this comment.
tokio is implementation detail and shouldn't be mentioned
| | **Consistent rendering** | Yes | No | No | No | Yes (CEF) | | ||
| | **Process model** | Multi-process | Multi-process | Multi-process | Single process | Multi-thread | | ||
| | **Backend ↔ UI** | IPC | IPC | IPC | Native Rust | In-process channels | | ||
| | **App size** | ~100 MB+ | ~14 MB | ~2–10 MB | ~5 MB | varies (CEF or system) | |
There was a problem hiding this comment.
Put actual values, varies looks bad if all other have size specified
| | **Process model** | Multi-process | Multi-process | Multi-process | Single process | Multi-thread | | ||
| | **Backend ↔ UI** | IPC | IPC | IPC | Native Rust | In-process channels | | ||
| | **App size** | ~100 MB+ | ~14 MB | ~2–10 MB | ~5 MB | varies (CEF or system) | | ||
| | **npm / Node compat** | Yes (it is Node) | Yes (via Bun) | No | No | Yes (Deno's Node compat) | |
| | **Framework auto-detect** | No | No | No | No | Yes | | ||
| | **HMR** | No | Yes | Yes (Vite-based) | Yes (`dx serve`) | Yes | | ||
| | **Built-in auto-update** | Full binary | bsdiff | Plugin | None | bsdiff | | ||
| | **Built-in installers** | Yes | No | Yes | No | Partial (DMG, AppImage) | |
| supports cross-platform builds via electron-builder, but needs Node and | ||
| platform-specific signing tools per target. | ||
|
|
||
| **Full Node compatibility, with a choice of engine.** Electron bundles both |
There was a problem hiding this comment.
| **Full Node compatibility, with a choice of engine.** Electron bundles both | |
| **Full Node compatibility, with a choice of backend.** Electron bundles both |
| **Electrobun — fast iteration on macOS.** Electrobun's start-up speed and HMR | ||
| are excellent on macOS. If you only ship Mac apps and like the Bun ecosystem, it | ||
| is a strong choice. |
Summary
Adds a reference page for the new (experimental)
deno desktopsubcommand from the 2.8 milestone (denoland/deno#33441). The page documents the public-facing surface in the upstream PR and explicitly marks it experimental, since the API is still evolving.Covered:
deno desktop .).cef,webview,raw— and how WEF binaries are downloaded/cached.--hmrflow.Deno.BrowserWindowAPI surface (window lifecycle,bind/unbindRPC,executeJs, menus, native handle), plusDeno.dockandDeno.Tray.prompt()/alert()/confirm()and thedesktop.errorReporting.urlhook.--inspect/--inspect-brk/--inspect-wait).Deno.autoUpdate,Deno.desktopVersion)..app/.dmg/.exe/.AppImage).desktopconfig block indeno.json.Also notes what is not yet implemented (codesigning, MSI, deb/rpm, notifications, clipboard, secureStorage).
Sidebar entry in
runtime/_data.ts, entry in the CLI index page.Test plan
deno task serve— page renders, sidebar entry resolves.